package com.lpdemilis.pokermanager;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;

public class Event implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private String name;
	private String description;
	private int groupid;
	private int userid;
	private String place;
	private Calendar timestart;
	private Calendar timeconfirm;
	private int maxusers;
	private int minusers;
	private int roundtime;
	private Double buyinvalue;
	private Double rebuyvalue;
	private Double addonvalue;
	private ArrayList<Number> prize;
	private ArrayList<Number> point;
	private int prizemod;
	private ArrayList<Number> smallBlinds;
	private ArrayList<Number> bigBlinds;
	private Boolean doubleBlinds;
	private int currentround;
	private int currenttime;
	private Boolean finalized;
	private Calendar timemodified;
	private ArrayList<Number> confirmeduseridsArrayList;
	private ArrayList<String> confirmedusernamesArrayList;
	private ArrayList<Calendar> timeconfirmationsArrayList;
	private ArrayList<Number> confirmationsArrayList;
	private Boolean userCanEdit;
	private ArrayList<Number> useridsArrayList;
	private ArrayList<String> usernamesArrayList;
	private ArrayList<Number> buyinsArrayList;
	private ArrayList<Number> rebuysArrayList;
	private ArrayList<Number> addonsArrayList;
	private ArrayList<Number> eliminatedsArrayList;
	private Boolean started;
	private Boolean running;
	
	public Event() {
		super();
		prize = new ArrayList<Number>();
		point = new ArrayList<Number>();
		smallBlinds = new ArrayList<Number>();
		bigBlinds = new ArrayList<Number>();
		confirmeduseridsArrayList = new ArrayList<Number>();
		confirmedusernamesArrayList = new ArrayList<String>();
		timeconfirmationsArrayList = new ArrayList<Calendar>();
		confirmationsArrayList = new ArrayList<Number>();
		useridsArrayList = new ArrayList<Number>();
		usernamesArrayList = new ArrayList<String>();
		buyinsArrayList = new ArrayList<Number>();
		rebuysArrayList = new ArrayList<Number>();
		addonsArrayList = new ArrayList<Number>();
		eliminatedsArrayList = new ArrayList<Number>();
		started = false;
		running = false;
	}


	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getGroupid() {
		return groupid;
	}

	public void setGroupid(int groupid) {
		this.groupid = groupid;
	}

	public int getUserid() {
		return userid;
	}

	public void setUserid(int userid) {
		this.userid = userid;
	}

	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	public Calendar getTimestart() {
		return timestart;
	}

	public void setTimestart(Calendar timestart) {
		this.timestart = timestart;
	}

	public Calendar getTimeconfirm() {
		return timeconfirm;
	}

	public void setTimeconfirm(Calendar timeconfirm) {
		this.timeconfirm = timeconfirm;
	}

	public int getMaxusers() {
		return maxusers;
	}

	public void setMaxusers(int maxusers) {
		this.maxusers = maxusers;
	}

	public int getMinusers() {
		return minusers;
	}

	public void setMinusers(int minusers) {
		this.minusers = minusers;
	}

	public int getRoundtime() {
		return roundtime;
	}

	public void setRoundtime(int roundtime) {
		this.roundtime = roundtime;
	}

	public Double getBuyinvalue() {
		return buyinvalue;
	}

	public void setBuyinvalue(Double buyinvalue) {
		this.buyinvalue = buyinvalue;
	}

	public Double getRebuyvalue() {
		return rebuyvalue;
	}

	public void setRebuyvalue(Double rebuyvalue) {
		this.rebuyvalue = rebuyvalue;
	}

	public Double getAddonvalue() {
		return addonvalue;
	}

	public void setAddonvalue(Double addonvalue) {
		this.addonvalue = addonvalue;
	}

	public ArrayList<Number> getPrize() {
		return prize;
	}

	public void setPrize(ArrayList<Number> prize) {
		this.prize = prize;
	}

	public ArrayList<Number> getPoint() {
		return point;
	}

	public void setPoint(ArrayList<Number> point) {
		this.point = point;
	}

	public int getPrizemod() {
		return prizemod;
	}

	public void setPrizemod(int prizemod) {
		this.prizemod = prizemod;
	}

	public ArrayList<Number> getSmallBlinds() {
		return smallBlinds;
	}

	public void setSmallBlinds(ArrayList<Number> smallBlinds) {
		this.smallBlinds = smallBlinds;
	}

	public ArrayList<Number> getBigBlinds() {
		return bigBlinds;
	}

	public void setBigBlinds(ArrayList<Number> bigBlinds) {
		this.bigBlinds = bigBlinds;
	}

	public int getCurrentround() {
		return currentround;
	}

	public void setCurrentround(int currentround) {
		this.currentround = currentround;
	}

	public int getCurrenttime() {
		return currenttime;
	}

	public void setCurrenttime(int currenttime) {
		this.currenttime = currenttime;
	}

	public Double getTotalprize() {
		Double totalprize = Double.valueOf(0);

		totalprize = (buyinsArrayList.size() * buyinvalue) + (rebuysArrayList.size() * rebuyvalue) + (addonsArrayList.size() * addonvalue);
		
		return totalprize;
	}	

	public Boolean getFinalized() {
		return finalized;
	}

	public void setFinalized(Boolean finalized) {
		this.finalized = finalized;
	}

	public Calendar getTimemodified() {
		return timemodified;
	}

	public void setTimemodified(Calendar timemodified) {
		this.timemodified = timemodified;
	}

	public ArrayList<Number> getConfirmeduseridsArrayList() {
		return confirmeduseridsArrayList;
	}

	public void setConfirmeduseridsArrayList(
			ArrayList<Number> confirmeduseridsArrayList) {
		this.confirmeduseridsArrayList = confirmeduseridsArrayList;
	}

	public ArrayList<Calendar> getTimeconfirmationsArrayList() {
		return timeconfirmationsArrayList;
	}

	public void setTimeconfirmationsArrayList(
			ArrayList<Calendar> timeconfirmationsArrayList) {
		this.timeconfirmationsArrayList = timeconfirmationsArrayList;
	}

	public ArrayList<Number> getConfirmationsArrayList() {
		return confirmationsArrayList;
	}

	public void setConfirmationsArrayList(
			ArrayList<Number> confirmationsArrayList) {
		this.confirmationsArrayList = confirmationsArrayList;
	}

	public ArrayList<String> getConfirmedusernamesArrayList() {
		return confirmedusernamesArrayList;
	}

	public void setConfirmedusernamesArrayList(
			ArrayList<String> confirmedusernamesArrayList) {
		this.confirmedusernamesArrayList = confirmedusernamesArrayList;
	}

	public Boolean getUserCanEdit() {
		return userCanEdit;
	}

	public void setUserCanEdit(Boolean userCanEdit) {
		this.userCanEdit = userCanEdit;
	}

	public ArrayList<Number> getUseridsArrayList() {
		return useridsArrayList;
	}

	public void setUseridsArrayList(ArrayList<Number> useridsArrayList) {
		this.useridsArrayList = useridsArrayList;
	}

	public ArrayList<String> getUsernamesArrayList() {
		return usernamesArrayList;
	}

	public void setUsernamesArrayList(ArrayList<String> usernamesArrayList) {
		this.usernamesArrayList = usernamesArrayList;
	}

	public Boolean getDoubleBlinds() {
		return doubleBlinds;
	}

	public void setDoubleBlinds(Boolean doubleBlinds) {
		this.doubleBlinds = doubleBlinds;
	}

	public Double getTotalpoint() {
		Double points = Double.valueOf(0);
		for (int i = 0; i < point.size(); i++) {
			points += point.get(i).doubleValue();
		}

		return points;
	}

	public ArrayList<Number> getBuyinsArrayList() {
		return buyinsArrayList;
	}

	public void setBuyinsArrayList(ArrayList<Number> buyinsArrayList) {
		this.buyinsArrayList = buyinsArrayList;
	}

	public ArrayList<Number> getRebuysArrayList() {
		return rebuysArrayList;
	}

	public void setRebuysArrayList(ArrayList<Number> rebuysArrayList) {
		this.rebuysArrayList = rebuysArrayList;
	}

	public ArrayList<Number> getAddonsArrayList() {
		return addonsArrayList;
	}

	public void setAddonsArrayList(ArrayList<Number> addonsArrayList) {
		this.addonsArrayList = addonsArrayList;
	}
	
	public ArrayList<Number> getEliminatedsArrayList() {
		return eliminatedsArrayList;
	}


	public void setEliminatedsArrayList(ArrayList<Number> eliminatedsArrayList) {
		this.eliminatedsArrayList = eliminatedsArrayList;
	}

	public void addBuyin(int userid) {
		this.buyinsArrayList.add((Number) userid);
	}

	public void addRebuy(int userid) {
		this.rebuysArrayList.add(userid);
	}

	public void addAddon(int userid) {
		this.addonsArrayList.add(userid);
	}
	
	public void addEliminated(int userid) {
		this.eliminatedsArrayList.add(userid);
	}
	
	public void removeBuyin(int userid) {
		this.buyinsArrayList.remove(this.buyinsArrayList.lastIndexOf(userid));
	}

	public void removeRebuy(int userid) {
		this.rebuysArrayList.remove(this.rebuysArrayList.lastIndexOf(userid));
	}

	public void removeAddon(int userid) {
		this.addonsArrayList.remove(this.addonsArrayList.lastIndexOf(userid));
	}
	
	public void removeEliminated(int userid) {
		this.eliminatedsArrayList.remove(this.eliminatedsArrayList.lastIndexOf(userid));
	}


	public Boolean getStarted() {
		return started;
	}


	public void setStarted(Boolean started) {
		this.started = started;
	}


	public Boolean getRunning() {
		return running;
	}


	public void setRunning(Boolean running) {
		this.running = running;
	}
}


